package o;

import android.content.Context;
import android.os.Handler;
import android.os.Message;
import com.huawei.appgallery.packagemanager.api.bean.ManagerTask;
import o.cof.a;

public class cov extends Handler {
    private static final Object ˋ = new Object();
    private static cov ˏ;
    private Context ˊ;

    public static cov ˏ(Context context) {
        synchronized (ˋ) {
            if (ˏ == null) {
                ˏ = new cov(context);
            }
        }
        return ˏ;
    }

    public cov(Context context) {
        super(context.getMainLooper());
        this.ˊ = context.getApplicationContext();
    }

    public void handleMessage(Message message) {
        if (message.obj instanceof ManagerTask) {
            ManagerTask managerTask = (ManagerTask) message.obj;
            if (cod.INSTALL == managerTask.processType) {
                cnu.ˏ.ˊ("PackageInstallerActivityOverTimeHandler", " start PackageInstallerActivity timeout:" + ((a) managerTask.apkInfos.get(0)).toString());
                cps.ˏ(this.ˊ, managerTask);
            } else if (cod.UNINSTALL == managerTask.processType) {
                cnu.ˏ.ˊ("PackageInstallerActivityOverTimeHandler", " start PackageUninstallerActivity timeout:" + managerTask.packageName);
                cpy.ˊ(this.ˊ, managerTask);
            }
        }
    }
}
